<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>鼠标悬停3D翻转动画效果</title>
    <link rel="stylesheet" href="./css/reset.css" />
    <style>
      .container {
        width: 1290px;
        margin: 100px auto 0px;
      }

      .scene {
        width: 400px;
        height: 300px;
        /* border:2px solid red; */
        margin: 15px;
        float: left;
        perspective: 800px;
      }

      .scene .box {
        width: 400px;
        height: 300px;
        background-color: yellow;
        transition: transform ease 1s;
        position: relative;
        transform-style: preserve-3d;
      }

      .scene:hover .box {
        transform: rotateY(-180deg);
      }

      .scene .box .box-front {
        width: 400px;
        height: 300px;
        background-color: pink;
        position: absolute;
        left: 0px;
        top: 0px;
        z-index: 2;
      }

      .scene .box .box-mid {
        width: 400px;
        height: 300px;
        position: absolute;
        left: 0px;
        top: 0px;
        background-color: rgba(0, 0, 0, 0.5);
        transform: translateZ(-1px);
      }

      .scene .box .box-back {
        width: 200px;
        height: 200px;
        background-image: linear-gradient(to bottom right, #f6a94f, #c3d7db, #1c8f9e);
        position: absolute;
        top: 50%;
        margin-top: -100px;
        left: 50%;
        margin-left: -100px;
        transform: translateZ(-100px) rotateY(-180deg);
        padding: 20px;
        box-sizing: border-box;
      }

      .box-back h3 {
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        margin-bottom: 10px;
      }

      .box-back p {
        font-size: 14px;
        line-height: 25px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="scene">
        <div class="box">
          <div class="box-front">
            <img src="images/3d01.jpg" alt="" width="400" height="300" />
          </div>

          <div class="box-mid"></div>

          <div class="box-back">
            <h3>中国摄影网素材</h3>
            <p>湖光山色风景图片,主题为村庄风景,可用作山村景色、民居、山水风景、南湾湖等相关设计的参考图片素材</p>
          </div>
        </div>
      </div>

      <div class="scene">
        <div class="box">
          <div class="box-front">
            <img src="images/3d02.jpg" alt="" width="400" height="300" />
          </div>

          <div class="box-mid"></div>

          <div class="box-back">
            <h3>中国摄影网素材</h3>
            <p>湖光山色风景图片,主题为村庄风景,可用作山村景色、民居、山水风景、南湾湖等相关设计的参考图片素材</p>
          </div>
        </div>
      </div>

      <div class="scene">
        <div class="box">
          <div class="box-front">
            <img src="images/3d03.jpg" alt="" width="400" height="300" />
          </div>

          <div class="box-mid"></div>

          <div class="box-back">
            <h3>中国摄影网素材</h3>
            <p>湖光山色风景图片,主题为村庄风景,可用作山村景色、民居、山水风景、南湾湖等相关设计的参考图片素材</p>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
